﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:HeritageAcademy.Library.Controls"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
	mc:Ignorable="d"
	x:Class="HeritageAcademy.Library.Controls.StatTable"
	x:Name="UserControl"
	UseLayoutRounding="True"
	d:DesignWidth="593.252" d:DesignHeight="429">
	<UserControl.Resources>
		<Style x:Key="ListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="Padding" Value="2,0,0,0"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBoxItem}">
						<Border x:Name="Bd">
							<ContentPresenter/>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<SolidColorBrush x:Key="ListBorder" Color="#828790"/>
		<Style x:Key="ListBoxStyle" TargetType="{x:Type ListBox}">
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
			<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
			<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBox}">
						<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="1" SnapsToDevicePixels="true">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="ValidationStates">
									<VisualState x:Name="Valid"/>
									<VisualState x:Name="InvalidFocused"/>
									<VisualState x:Name="InvalidUnfocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<VisualStateManager.CustomVisualStateManager>
								<ei:ExtendedVisualStateManager/>
							</VisualStateManager.CustomVisualStateManager>
							<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}" Template="{DynamicResource ScrollViewerControlTemplate}">
								<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
							</ScrollViewer>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							</Trigger>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ControlTemplate x:Key="ScrollViewerControlTemplate" TargetType="{x:Type ScrollViewer}">
			<Grid x:Name="Grid" Background="{TemplateBinding Background}">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="*"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<Rectangle x:Name="Corner" Grid.Column="1" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Row="1"/>
				<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
				<ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{DynamicResource ScrollBarStyle}"/>
			</Grid>
		</ControlTemplate>
		<LinearGradientBrush x:Key="VerticalScrollBarBackground" EndPoint="1,0" StartPoint="0,0">
			<GradientStop Color="#E1E1E1" Offset="0"/>
			<GradientStop Color="#EDEDED" Offset="0.20"/>
			<GradientStop Color="#EDEDED" Offset="0.80"/>
			<GradientStop Color="#E3E3E3" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ScrollBarDisabledBackground" Color="#F4F4F4"/>
		<Style x:Key="ScrollBarButton" TargetType="{x:Type RepeatButton}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RepeatButton}">
						<Microsoft_Windows_Themes:ScrollChrome x:Name="Chrome" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" SnapsToDevicePixels="true" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="{TemplateBinding Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph}"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RepeatButton}">
						<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Thumb}">
						<Rectangle x:Name="rectangle" RadiusX="4" RadiusY="4" Width="10" Fill="#FFE5E4E4">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.2"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle">
												<EasingColorKeyFrame KeyTime="0" Value="#FF999999"/>
											</ColorAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle">
												<EasingColorKeyFrame KeyTime="0" Value="#FF999999"/>
											</ColorAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
						</Rectangle>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="HorizontalScrollBarBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#E1E1E1" Offset="0"/>
			<GradientStop Color="#EDEDED" Offset="0.20"/>
			<GradientStop Color="#EDEDED" Offset="0.80"/>
			<GradientStop Color="#E3E3E3" Offset="1"/>
		</LinearGradientBrush>
		<Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RepeatButton}">
						<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ScrollBarStyle" TargetType="{x:Type ScrollBar}">
			<Setter Property="Background" Value="{StaticResource VerticalScrollBarBackground}"/>
			<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
			<Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="Width" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
			<Setter Property="MinWidth" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ScrollBar}">
						<Grid x:Name="Bg" SnapsToDevicePixels="true">
							<Grid.RowDefinitions>
								<RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/>
								<RowDefinition Height="0.00001*"/>
								<RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/>
							</Grid.RowDefinitions>
							<Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="0" RenderTransformOrigin="0.5,0.5" Grid.RowSpan="3">
								<Track.RenderTransform>
									<TransformGroup>
										<ScaleTransform/>
										<SkewTransform/>
										<RotateTransform Angle="0.062"/>
										<TranslateTransform/>
									</TransformGroup>
								</Track.RenderTransform>
								<Track.DecreaseRepeatButton>
									<RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
								</Track.DecreaseRepeatButton>
								<Track.IncreaseRepeatButton>
									<RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
								</Track.IncreaseRepeatButton>
								<Track.Thumb>
									<Thumb Style="{StaticResource ScrollBarThumb}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="VerticalGripper"/>
								</Track.Thumb>
							</Track>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Style.Triggers>
				<Trigger Property="Orientation" Value="Horizontal">
					<Setter Property="Width" Value="Auto"/>
					<Setter Property="MinWidth" Value="0"/>
					<Setter Property="Height" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
					<Setter Property="MinHeight" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
					<Setter Property="Background" Value="{StaticResource HorizontalScrollBarBackground}"/>
					<Setter Property="Template">
						<Setter.Value>
							<ControlTemplate TargetType="{x:Type ScrollBar}">
								<Grid x:Name="Bg" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
									<Grid.ColumnDefinitions>
										<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
										<ColumnDefinition Width="0.00001*"/>
										<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
									</Grid.ColumnDefinitions>
									<RepeatButton Command="{x:Static ScrollBar.LineLeftCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="LeftArrow"/>
									<Track x:Name="PART_Track" Grid.Column="1" IsEnabled="{TemplateBinding IsMouseOver}">
										<Track.DecreaseRepeatButton>
											<RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
										</Track.DecreaseRepeatButton>
										<Track.IncreaseRepeatButton>
											<RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
										</Track.IncreaseRepeatButton>
										<Track.Thumb>
											<Thumb Style="{StaticResource ScrollBarThumb}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="HorizontalGripper"/>
										</Track.Thumb>
									</Track>
									<RepeatButton Grid.Column="2" Command="{x:Static ScrollBar.LineRightCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="RightArrow"/>
								</Grid>
								<ControlTemplate.Triggers>
									<Trigger Property="IsEnabled" Value="false">
										<Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
									</Trigger>
								</ControlTemplate.Triggers>
							</ControlTemplate>
						</Setter.Value>
					</Setter>
				</Trigger>
			</Style.Triggers>
		</Style>
	</UserControl.Resources>

	<Grid x:Name="grid">
		<Grid.RowDefinitions>
			<RowDefinition Height="35"/>
			<RowDefinition/>
		</Grid.RowDefinitions>
		<Grid x:Name="grdHeader">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="52"/>
				<ColumnDefinition Width="96"/>
				<ColumnDefinition Width="96"/>
				<ColumnDefinition/>
			</Grid.ColumnDefinitions>
			<Border x:Name="brdBottom" BorderBrush="Black" BorderThickness="0,0,0,2" Grid.ColumnSpan="4"/>
			<Border BorderBrush="Black" BorderThickness="0,0,1,0" Margin="0,0,0,-1"/>
			<Border BorderBrush="Black" BorderThickness="0,0,1,0" Margin="0,0,0,-1" Grid.Column="1"/>
			<Border BorderBrush="Black" BorderThickness="0,0,1,0" Margin="0,0,0,-1" Grid.Column="2"/>
			<Label Content="Гл." d:LayoutOverrides="Width" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="13.333" FontWeight="Bold"/>
			<Label Content="Вопросы" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="13.333" Grid.Column="1" d:LayoutOverrides="GridBox" FontWeight="Bold"/>
			<Label Content="Задачи" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="13.333" Grid.Column="2" FontWeight="Bold"/>
			<Label Content="Успехи" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="13.333" Grid.Column="3" FontWeight="Bold"/>
			<Border BorderBrush="Black" BorderThickness="0,0,1,0" Margin="0,0,0,-1" Grid.Column="3"/>
		</Grid>
		<Border BorderBrush="Black" BorderThickness="0,0,1,0" Grid.Row="1"/>
		<ListBox x:Name="lbCourseStat" Grid.Row="1" Background="{x:Null}" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" BorderBrush="{x:Null}" BorderThickness="0" Margin="0" ItemContainerStyle="{DynamicResource ListBoxItemStyle}" Style="{DynamicResource ListBoxStyle}">
			<local:StatTableRow d:LayoutOverrides="Height" ScrollViewer.VerticalScrollBarVisibility="Disabled" Padding="0" Margin="-1,0,0,0" QuestionAll="8" QuestionsActual="7" TasksAll="22" TasksActual="15" Chapter="1"/>
            <local:StatTableRow d:LayoutOverrides="Height" ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="-1,0,0,0" QuestionAll="16" QuestionsActual="3" TasksActual="34" Chapter="2" TasksAll="53"/>
            <local:StatTableRow d:LayoutOverrides="Height" ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="-1,0,0,0" QuestionAll="45" QuestionsActual="26" TasksActual="14" TasksAll="23" Chapter="3"/>
            <local:StatTableRow d:LayoutOverrides="Height" ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="-1,0,0,0" QuestionAll="15" QuestionsActual="15" TasksActual="41" TasksAll="41" Chapter="4"/>
            <local:StatTableRow d:LayoutOverrides="Height" ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="-1,0,0,0" QuestionAll="18" QuestionsActual="3" TasksActual="21" TasksAll="33" Chapter="5"/>
            <local:StatTableRow d:LayoutOverrides="Height" ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="-1,0,0,0" QuestionsActual="8" Chapter="6" QuestionAll="24" TasksActual="12" TasksAll="14"/>
            <local:StatTableRow ScrollViewer.VerticalScrollBarVisibility="Disabled" Padding="0" Margin="-1,0,0,0" QuestionAll="8" QuestionsActual="7" TasksAll="22" TasksActual="22" d:LayoutOverrides="Height" Chapter="7"/>
            <local:StatTableRow ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="-1,0,0,0" QuestionAll="16" QuestionsActual="3" TasksActual="34" Chapter="8" d:LayoutOverrides="Height" TasksAll="35"/>
            <local:StatTableRow ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="-1,0,0,0" QuestionAll="45" QuestionsActual="26" TasksActual="23" TasksAll="23" Chapter="9" d:LayoutOverrides="Height"/>
            <local:StatTableRow ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="-1,0,0,0" QuestionAll="15" QuestionsActual="15" TasksActual="33" TasksAll="41" Chapter="10" d:LayoutOverrides="Height"/>
            <local:StatTableRow ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="-1,0,0,0" QuestionAll="18" QuestionsActual="3" TasksActual="21" TasksAll="33" Chapter="11" d:LayoutOverrides="Height"/>
            <local:StatTableRow ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="-1,0,0,0" QuestionsActual="8" Chapter="12" d:LayoutOverrides="Height" QuestionAll="9" TasksActual="6" TasksAll="13"/>
		</ListBox>
	</Grid>
</UserControl>